package com.example.volunteer.mapper;


import com.example.volunteer.model.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;


@Mapper
public interface AdminMapper {
    void insert(Admin admin);
    Admin findById(String adminId);
    Admin findByEmail(String email);
    void update(Admin admin);
    void delete(Admin admin);

    List<Admin> findAdminsWithPage(@Param("offset") int offset, @Param("pageSize") int pageSize);
    int countAdmins();

    List<Admin> findByNameWithPage(@Param("name") String name, @Param("offset") int offset, @Param("pageSize") int pageSize);
    int countByName(@Param("name") String name);

    List<Admin> findByEmailWithPage(@Param("email") String email, @Param("offset") int offset, @Param("pageSize") int pageSize);
    int countByEmail(@Param("email") String email);

    List<Admin> findByContactWithPage(@Param("contact") String contact, @Param("offset") int offset, @Param("pageSize") int pageSize);
    int countByContact(@Param("contact") String contact);
}

